package com.wyl.pmd.rule.bestpractices;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AvoidPrintStackTrace {

	private static final Logger LOGGER = LoggerFactory.getLogger(AvoidPrintStackTrace.class);
	
	void bar() {
        try {
            // do something
        } catch (Exception e) {
            e.printStackTrace(); // bad
        }
        
        try {
            // do something
        } catch (Exception e) {
        	LOGGER.error("业务异常", e); // good
        }
    }
	
}
